package com.ext.portlet.registration.service.impl;

import java.rmi.RemoteException;
import java.util.List;

import com.ext.portlet.registration.NoSuchCollegeException;
import com.ext.portlet.registration.model.College;
import com.ext.portlet.registration.model.School;
import com.ext.portlet.registration.service.base.CollegeLocalServiceBaseImpl;
import com.ext.portlet.registration.service.persistence.CollegeUtil;
import com.liferay.portal.PortalException;
import com.liferay.portal.SystemException;


public class CollegeLocalServiceImpl extends CollegeLocalServiceBaseImpl {
	
	public List<College> getAllColleges()
	throws PortalException, SystemException, RemoteException {
		return collegePersistence.findAll();
	}
	
	public List<College> getByStatus(Integer status) throws SystemException{
		return CollegeUtil.findByStatus(status);
	}
	
	public College getBySecretPin(String secretPin) throws NoSuchCollegeException, SystemException{		
		
		return CollegeUtil.findBySecretPin(secretPin);
	}
	
	public College secretPinValidation (String secretPin) throws SystemException{		
		
		return collegePersistence.fetchBySecretPin(secretPin);
	}
	
	public College getByEmail(String emailAddress) throws SystemException{
		return collegePersistence.fetchByCpEmailAddress(emailAddress);
	}
	
	public College getByLoginId(String loginId) throws NoSuchCollegeException, SystemException{		
		
		return CollegeUtil.fetchByLoginId(loginId);
	}
	
	public List<College> getByUserId(Long userId) 
	       throws SystemException {	

	     return collegePersistence.findByUserId(userId);
}	
	
}
